﻿define([
], function () {

    var controller = BackboneMVC.Controller.extend({
        name: 'rolManager',
        show: function ($el, id) {
            require([(__currentSession.userLogin.toLowerCase() == 'super') ? 'views/crud/rol/super/rolManager' : 'views/crud/rol/common/rolManager'], function (View) {
                var view = new View();
                view.constructor({ companyId: id });
                view.setElement($el);
                view.render();
            });
        },
        showEdit: function ($el, id) {
            require([(__currentSession.userLogin.toLowerCase() == 'super') ? 'views/crud/rol/super/rolEdit' : 'views/crud/rol/common/rolEdit'], function (View) {
                var view = new View();
                view.constructor({ rolId: id });
                view.setElement($el);
                view.render();
            });
        },
        addData: function ($el) {
            require([(__currentSession.userLogin.toLowerCase() == 'super') ? 'views/crud/rol/super/rolCreate' : 'views/crud/rol/common/rolCreate'], function (View) {
                var view = new View();
                view.setElement($el);
                view.render();
            });
        }
    });
    return controller;
});